<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class CabinetAlarm extends Model
{
    protected $table = 'xfy_cabinet_alarms';
    protected $primaryKey = 'id';

    const LEVEL_GENERAL = 1;
    const LEVEL_SERIOUS = 2;
    const LEVEL_URGENT = 3;

    const ACTIVE_YES = 1;
    const ACTIVE_NO = 0;

    const MAY_ALARM_YES = 1;
    const MAY_ALARM_NO = 0;

    const LEVEL_TEXT = ['1' => '一般报警', '2' => '严重报警', '3' => '紧急报警'];
    const ACTIVE_TEXT = ['0' => '禁用', '1' => '启用'];

    const CONDITION = ['>', '<', '>=', '<=', '='];
    const CONDITION_TEXT = ['>' => '大于', '<' => '小于', '>=' => '大于等于', '<=' => '小于等于', '=' => '等于'];
}